﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using FoneBuddy.LinqModel;
using FoneBuddy.LinqModel.Data;
using FoneBuddy.LinqData;

public partial class _Default : System.Web.UI.Page
{
    #region Variable Declaration
    IDataRepository _dataObject = new DataRepository();
    Country country;
    List<Country> countries = new List<Country>();
    #endregion

    int[] array = new int[100];
        int temp;

    protected void Page_Load(object sender, EventArgs e)
    {
        //for (int i = 0; i < 5; i++){


        //}
        array[0] = 12;
        array[1] = 14;
        array[2] = 8;
        array[3] = 6;
        array[4] = 16;

        
        if (!IsPostBack)
        {
            getCountries();
            Address address = new Address();
            address = new Address(_dataObject);
            address.Address1 = "address1";
            address.Address2 = "address2";
            address.Pincode = "38013";
            address.CountryId = (Int32)EnumClass.Enums.Country.India;
            address.StateId = 1;
            address.CityId = 12;
            address.CreatedDate = DateTime.Now;
            address.IsActive = true;
            address.IsDeleted = false;
            address.IpAdded = HttpContext.Current.Request.UserHostAddress;
            address.MerchantId = 1;
            address.Create();
        }
        for (int i = 0; i < 5; i++)
        {
            for(int j=i;j<5;j++)
            {
                if (array[i] < array[j])
                {
                    temp = array[i];
                    array[i] = array[j];
                    array[j] = temp;
                }
            }
        }
        int[] arr1 = array;
    }
    private void getCountries()
    {
        country = new Country(_dataObject);
        countries = country.GetAllCountry();

        if (countries != null)
        {

        }
    }
}
